{% extends "SisGGFinalBundle:Usuario:user.html.twig" %}
{% block title %}Provincias{% endblock %}
{% block name %}Kito's Local{% endblock%}
{% block descripcion %}Lorem ipsum ad his scripta blandit partiendo, eum fastidii accumsan euripidis in, eum liber hendrerit an. Qui ut wisi vocibus suscipiantur, quo dicit ridens inciderint id. Quo mundi lobortis reformidans eu, legimus senserit definiebas an eos. Eu sit tincidunt incorrupte definitionem, vis mutat affert percipit cu, eirmod consectetuer signiferumque eu per. In usu latine equidem dolores. Quo no falli viris intellegam, ut fugit veritus placerat per.{% endblock%}
{% block content %}
        <legend>Provincias</legend>   
        {% if msj!="" %}
            <div class="alert alert-success">
            <button type='button' class='close' data-dismiss='alert'>×</button>
            <strong>Muy bien! </strong> {{ msj }}
            </div>  
        {% endif %}
        {% if error %}
            <div class="alert alert-block">
                <button type="button" class="close" data-dismiss="alert">×</button>
                <h4>¡CUIDADO!</h4>
                {{ error }}
            </div>
        {% endif %}
        <table class="table table-hover" data-spy="scroll">
            <thead class="header">
            <tr>
                <th>Nombre</th>
                <th colspan="2">Acciones</th>
            </tr>
            </thead>
            {% for provincia in provincias%}
             <tr>
                <td>{{provincia.nombre}}</td>
                <div id="{{provincia.id}}" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none; ">
                    <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                        <h3 id="myModalLabel">Eliminar Cliente</h3>
                    </div>
                    <div class="modal-body">
                        <p>¿Esta seguro que desea eliminar la provincia: {{provincia.nombre}}?</p>
                    </div>
                    <div class="modal-footer">
                        <form action="{{path('eliminarProvincia')}}" method="POST">
                            <input type="hidden" id="id" name="id" value="{{provincia.id}}"/>
                            <button type="submit" class="btn btn-primary" >Eliminar Provincia</a>
                        </form>
                        <button class="btn" data-dismiss="modal">Cancelar</button>
                    </div>
                </div>
                <td>
                    <form action="{{path('editarProvincia')}}" method="GET">
                       <input type="hidden" id="id" name="id" value="{{provincia.id}}"/>
                       <button type="submit" rel="tooltip" title="Editar" class="btn"><i class="icon-edit"></i></button>
                    </form>   
                </td>
                <td>
                    <a class="btn" rel="tooltip" title="Eliminar" href="#{{provincia.id}}" data-toggle="modal"><i class="icon-remove"></i></a>
                </td>
            </tr>   
            {% endfor %}
        </table>        
{% endblock %}